package day9.Exer;

public class Saloon extends Car {
    private String model;

    public Saloon(String brand, String carNo, int rental, boolean rent, String model) {
        super(brand, carNo, rental, rent);
        this.model = model;
    }
    public Saloon(){}

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }
    @Override
    public void showinfo(){
        System.out.println("轿车  "+getBrand()+getModel()+",车牌"+getCarNo()+",租金"+getRental()+"元,"+this.tostring(this.isRent()));
    }
    public void showforleasing(){
        System.out.println("您租赁的车型是"+getBrand()+"车牌号"+getCarNo()+"型号"+getModel());
    }
    public double calRent(int day){
        if(day>150){
            return getRental()*day*0.7;
        }else if(day>30){
            return getRental()*day*0.8;
        }else if(day>15){
            return getRental()*day*0.9;
        }else{
            return getRental()*day;
        }
    }
}
